home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / host contacted / imengv3.41p2.lha / ImEngV3.41p2 / Extra / SuperView / arexx / SV_Export.rexx next >
OS/2 REXX Batch file  |  1997-01-09  |  2KB  |  73 lines

  1. /* 
  2. ** $VER: SV_Export.rexx 1.0, IE Arexx script
  3. ** Image Engineer Macro script
  4. ** Copyright © by Patrik M Nydensten 
  5. ** 9/1 1997 Stockholm/Sweden
  6. **
  7. ** This arexx script will export the PRIMARY image in Image Engineer
  8. ** to SuperView. Both programs must be running at the same time.
  9. ** This script was developed to work with SuperView 5.70 and
  10. ** Image Engineer 3.3.
  11. **
  12. */
  13.  
  14. OPTIONS RESULTS
  15. SIGNAL ON ERROR
  16. TEMP_FILE = 't:Image_from_IE'
  17. PORT = 'SuperView.rx'
  18.  
  19. if arg()==0 then exit
  20.  
  21. /* Main code */
  22.  
  23. IF ~SHOW('P',PORT) THEN DO
  24.   'REQUEST' '"Could not locate SuperView'x2c(27)'s arexx port!"' '" OK "'
  25.   CALL ErrorOut 0
  26. END
  27.  
  28. 'SAVE_DATA' arg(1) '"'||TEMP_FILE||'"' '"ILBM CmpByteRun1"'
  29. IF (RC ~= 0) THEN DO
  30.      'REQUEST' '"Error when saving temporary image!"' '" OK "'
  31.     CALL ErrorOut 10
  32. END
  33.  
  34. 'WB_TO_FRONT'
  35.  
  36. ADDRESS VALUE PORT
  37.  
  38. 'LOAD=' || TEMP_FILE
  39. IF (RC ~= 0) THEN DO
  40.   ADDRESS 'IMAGEENGINEER'
  41.   'IE_TO_FRONT'
  42.      'REQUEST' '"Error loading image into SuperView!"' '" OK "'
  43.     CALL ErrorOut 10
  44. END
  45.  
  46. CALL ErrorOut 0
  47.  
  48. /* Errorout procedure ----------------------- */
  49.  
  50. ErrorOut:
  51.     PARSE ARG ExitCode
  52.  
  53.     IF (EXISTS( TEMP_FILE )) THEN DO
  54.       ADDRESS COMMAND "Delete >NIL:" TEMP_FILE
  55.   END
  56.   
  57.     EXIT ExitCode
  58.  
  59. /* IE's error procedure --------------------- */
  60.  
  61. Error:
  62. if RC=5 then do
  63.   'IE_TO_FRONT'
  64.   'LAST_ERROR'
  65.   'REQUEST "'||RESULT||'"'
  66. end
  67. else do
  68.   'IE_TO_FRONT'
  69.   'LAST_ERROR'
  70.   'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  71. end
  72. CALL ErrorOut 0
  73.